package lpca.utils 
{
	import lpca.view.ViewCell;	
	/**
	 * ...	 
	 */

	public class Cell 
	{
        public static const CELL_WALL: int = 1; 
        public static const CELL_EMPTY: int = 0;
        public static const CELL_START: int = 2;
        public static const CELL_FINISH: int = 3;
        public static const CELL_WAY: int = 4			
		
		public var value: int;		
		public var valueWave: int;
		public var visibleValueWave: Boolean;
		public var checked: Boolean;
		public var visible: Boolean;		
		public var view: ViewCell;				
		
		public function Cell(value: int,checked: Boolean = false, visible: Boolean = false, view: ViewCell = null, valueWave: int = 0, 
							visibleValueWave: Boolean = false) 
		{
			this.value = value;
			this.visible = visible;
			this.checked = checked;
			this.view = view;	
			this.valueWave = valueWave;
			this.visibleValueWave = visibleValueWave;			
		}
		
		/*
		public function equal(cell: Cell): Boolean
		{
			if (cell == null) 
				return false;
			return (this.value == cell.value) && (this.checked == cell.checked) && (this.visible == cell.visible);
		}
		*/
		
		public static function isPassable(cell: Cell):Boolean
		{
			if (cell == null) return false;
			return (cell.value != CELL_WALL);			
		} 

		public function clone(): Cell
		{
			return new Cell(value, checked, visible, view, valueWave, visibleValueWave);			
		}		
	}
		

}